package dfl.bysj.controller;


import dfl.bysj.entity.VO.SeatStateVO;
import dfl.bysj.handler.NoAuth;
import dfl.bysj.result.R;
import dfl.bysj.service.SeatService;
import dfl.bysj.service.SeatStateService;
import dfl.bysj.service.StudentSeatRelationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author DFL
 * @since 2022-04-26
 */
@Slf4j
@RestController
@RequestMapping("/seatState")
public class SeatStateController {


    private StudentSeatRelationService studentSeatRelationService;

    @Autowired
    public void setStudentSeatRelationService(StudentSeatRelationService studentSeatRelationService) {
        this.studentSeatRelationService = studentSeatRelationService;
    }



    @NoAuth
    @GetMapping("/list")
    public R list(String resTimeId){
        log.info(resTimeId);

        List<SeatStateVO> seatStateVOList=studentSeatRelationService.getALLSeatStateVO(Integer.valueOf(resTimeId));
        return R.ok().data("seatStatelist",seatStateVOList);
    }
}

